From: Jasper St. Pierre Date: Wed, 7 Sep 2011 09:23:04 +0000 (-0400) Subject: altTab: Fix icon scrolling X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7647 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0f4ce5dd4e46dd441e59cca8a4ba6a01f2940d70;p=gnome-shell.git altTab: Fix icon scrolling Don't depend on the primary monitor position for determining whether we should scroll, just use our own container's size. https://bugzilla.gnome.org/show_bug.cgi?id=658239 --- diff --git a/js/ui/altTab.js b/js/ui/altTab.js index cbe6f6c48..b6409e744 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -636,11 +636,10 @@ SwitcherList.prototype = { this._items[this._highlighted].add_style_pseudo_class('selected'); } - let monitor = Main.layoutManager.primaryMonitor; - let itemSize = this._items[index].allocation.x2 - this._items[index].allocation.x1; - let [posX, posY] = this._items[index].get_transformed_position(); - posX += this.actor.x; - if (posX + itemSize > monitor.width + monitor.x) + let [absItemX, absItemY] = this._items[index].get_transformed_position(); + let [result, posX, posY] = this.actor.transform_stage_point(absItemX, 0); + let [containerWidth, containerHeight] = this.actor.get_transformed_size(); + if (posX + this._items[index].get_width() > containerWidth) this._scrollToRight(); else if (posX < 0) this._scrollToLeft();